{template 'common/header'}
{template 'web/task/navs'}

<style>
    .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {overflow: visible !important;}
    .dropdown-menu{min-width:4em;}
    .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {white-space: normal !important;overflow: visible !important;}
    .dropdown{display:inline-block !important;}
    .account-stat-num > div {width: 25%;float: left;font-size: 16px;text-align: center;}
    .account-stat-num > div span {display: block;font-size: 30px;font-weight: bold;}
</style>

<div class="panel panel-default">
    <div class="panel-heading">
        分类列表
    </div>
    <div class="panel-body">
        <table st-table="items" class="table table-striped table-condensed" style="display:auto;">
            <thead>
            <tr>
                <th style="width:5em;">顺序</th>
                <th style="width:12em;">分类名</th>
                <th style="width:6em;">图标</th>
                <th style="width:16em;">字段</th>
                <th style="width:6em;">任务总数</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {loop $list['list'] $li}
            <tr>
                <td>{$li['displayorder']}</td>
                <td>{$li['title']}</td>
                <td>
                    <img src="{php echo tomedia($li['icon'])}" style="width:4em;height:4em;" class="img-rounded"/>
                </td>
                <td>
                    {php $fields = M('category_field')->getAll(array('category_id'=>$li['id']))}
                    {loop $fields $field}
                    <label class="label label-info">{$field['title']}</label>
                    {/loop}
                </td>
                <td>
                    <label class="label label-info">{$li['task_num']}</label>
                </td>
                <td>
                    <a href="{php echo $this->createWebUrl('category_task',array('category_id'=>$li['id']))}" class="btn btn-default">任务管理</a>
                    <a href="{php echo $this->createWebUrl('category_setting',array('category_id'=>$li['id']))}" class="btn btn-default">基础设置</a>
                    <a href="{php echo $this->createWebUrl('category_field',array('category_id'=>$li['id']))}" class="btn btn-default">字段管理</a>
                    <a href="{php echo $this->createWebUrl('category',array('act'=>'edit','id'=>$li['id']))}" class="btn btn-default">编辑</a>
                    <a href="{php echo $this->createWebUrl('category',array('act'=>'delete','id'=>$li['id']))}" class="btn btn-danger">删除</a>
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
        {php echo $list['pager']}
    </div>

    <div class="panel-footer">
        <a href="{php echo $this->createWebUrl('category',array('act'=>'edit'))}" class="btn btn-default">新增</a>
    </div>
</div>
{template 'common/footer'}